<script language="javascript">
	function goto_addnew_classify(){
		document.forms[0].action='<?=site_url("classify/goto_addnew_classify")?>';
		document.forms[0].submit();
	}
	
</script>
<form name="" method="post">
<div id="border">   
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
     <td valign="top">       
        <table width="705" border="0" align="center" id="usertitle">
          <tr>
            <td><h3 style="">Classified Ads</h3></td>
            <td align="right"><img src="<?=base_url();?>images/Secure_connection.gif" alt="" width="116" height="22" /></td>
          </tr>
        </table>
        <div id="register">
        <div class="user_line_border_top">&nbsp;</div>
            <div style="margin:30px auto;"></div>
    <?php foreach($all_ads->result() as $ads):?>
    <table width="100%" border="0">
        <tr>
          <td width="15%" valign="top" align="center">
           <?php $getimg=$this->m_classify->select_first_img($ads->product_id);?>
          <a href="<?=site_url("classify/goto_classify_detail/$ads->product_id")?>">
             <?php if($getimg['img_name']<>''){ ?>
                 <img src="<?=base_url();?><?=$ads->file_path;?><?=$getimg['img_name'];?>" width="90" height="60"/>
             <?php }else{?>
                 <img src="<?=base_url();?>classify/nopic.gif" width="90" height="60"/>
              <? } ?>
           </a>
           </td>
          <td width="42%" valign="top"><a href="<?=site_url("classify/goto_classify_detail/$ads->product_id")?>"><b><?=substr(htmlspecialchars($ads->product_name),0,39)."..";?></b></a><br />
		  <?=substr(htmlspecialchars($ads->product_desc),0,49)."..";?></td>
          <td width="23%" valign="top"><b>$<?=$ads->price;?></b><br />
        Within 24hrs  </br><font color="#FF0000"><b>Yes</b></font><br />More Mice & Keyboards</b></td>
          <td width="15%" valign="top"><b><?=htmlspecialchars(date_postgres_to_html($ads->date_close));?><br />
          	</b>from <font color="#0000FF">
			<?=$ads->user_login;?></font><br /> <?php $total_hit=$this->m_classify->get_product_hit($ads->product_id); ?>
          	<font color="#FF0000"><?=count($total_hit->result());?></font> Hit(s)
          </td>
          <td><a href="<?=site_url("classify/goto_update_classify/$ads->product_id")?>">edit</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="<?=site_url("classify/renew_post/$ads->product_id")?>">renew</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          	  <a href="<?=site_url("classify/delete_classify/$ads->product_id")?>">delete</a></td>
        </tr>
  	</table>
    <? endforeach;?>
	<div id="pagesize" align="center"><?php echo $this->pagination->create_links(); ?></div>
    <div align="center">
    			<input type="button" name="btnaddnew" class="bottom" value="New Post" onClick="goto_addnew_classify()" />
	</div><br />
                
        </div>
        </td>
        <td width="254" valign="top">
			<?php include APPPATH."views/templates/common/right_content.php"; ?>
         </td>
         
      </tr>
  </table>
</div>
</form>